<?php echo Common::css("v1/base.css,v1/admin.css,v1/home.css")?>
<div class="header-wrapper">
    <div class="header-logo">
        {if !$userinfo['logo']}
            {if !$logo}
            <img src="{$GLOBALS['cfg_res_url']}/images/pic/logo.png" alt="" class="">
            {else}
            <img src="{Common::img($logo)}" alt="" class="">
            {/if}
        {else}
            <img src="{$userinfo['logo']}" alt="" class="">
        {/if}
    </div>
    <!-- logo -->
    <div class="header-nav">
        <ul class="header-nav-group clearfix">
            <li class="menu_list_v menu_index" onclick="setTopMenuStyle('index')"><a href="/plugins/supplier/pc/index" class="nav-item" >首页</a></li>
            <?php if($is_pro){?>
            <li class="menu_list_v menu_bill" onclick="setTopMenuStyle('bill')"><a href="/plugins/supplier/pc/pub/bill" class="nav-item" >订单</a></li>
            <?php } ?>
            <li class="menu_list_v menu_sale" onclick="setTopMenuStyle('sale')">
                <a  href="/plugins/supplier/index/cms" class="nav-item">分销
                    <i class="arrow-icon"></i></a>
                <div class="sub-scroll-wrap">
                    <ul class="sub-list-group">
                        <li><a  href="/plugins/supplier/index/cms"class="sub-item" id="item-c-cms">CMS</a></li>
                        {if $lyc}
                        <li><a href="/plugins/supplier/index/lyc" class="sub-item">旅游村</a></li>
                        {/if}

                        {if $meituan_ticket}
                        <li><a href="/meituan_ticket" class="sub-item">美团</a></li>
                        {/if}
                        <!--
                        {if !empty($check_product)}
                        <li><a href="/plugins/supplier_check/" class="sub-item">验单</a></li>
                        {/if}
                        {if !empty($finance_manage)}
                        <li><a href="/plugins/supplier/brokerage/" class="sub-item">财务</a></li>
                        {/if}
                        -->
                    </ul>
                </div>
            </li>
            <?php if($is_pro){?>
            <li class="menu_list_v menu_pro" onclick="setTopMenuStyle('pro')">
                <a href="javascript:;" class="nav-item">产品<i class="arrow-icon"></i></a>
                <div class="sub-scroll-wrap">
                    <ul class="sub-list-group">
                        <?php $default_url = '';?>
                        {if !empty($line_product)}
                        <?php if(!$default_url) $default_url = '/plugins/supplier_line/';?>
                        <li><a href="/plugins/supplier_line/" class="sub-item">线路</a></li>
                        {/if}
                        {if !empty($spot_product)}
                        <?php if(!$default_url) $default_url = '/plugins/supplier_spot/';?>
                        <li><a href="/plugins/supplier_spot/" class="sub-item">门票</a></li>
                        {/if}
                        {if !empty($hotel_product)}
                        <?php if(!$default_url) $default_url = '/plugins/supplier_hotel/';?>
                        <li><a href="/plugins/supplier_hotel/" class="sub-item">酒店</a></li>
                        {/if}
                        {if !empty($car_product)}
                        <?php if(!$default_url) $default_url = '/plugins/supplier_car/';?>
                        <li><a href="/plugins/supplier_car/" class="sub-item">租车</a></li>
                        {/if}
                        {if !empty($tuan_product)}
                        <?php if(!$default_url) $default_url = '/plugins/supplier_line/';?>
                        <li><a href="/plugins/supplier_tuan/" class="sub-item">团购</a></li>
                        {/if}
                        {if !empty($techan_product)}
                        <?php if(!$default_url) $default_url = '/plugins/supplier_techan/';?>
                        <li><a href="/plugins/supplier_techan/" class="sub-item">特产</a></li>
                        {/if}
                        {if !empty($food_product)}
                        <?php if(!$default_url) $default_url = '/plugins/supplier/food/';?>
                        <li><a href="/plugins/supplier/food" class="sub-item">美食</a></li>
                        {/if}
                        {if !empty($outdoor_product)}
                        <?php if(!$default_url) $default_url = '/plugins/supplier/outdoor/';?>
                        <li><a href="/plugins/supplier/outdoor/" class="sub-item">户外活动</a></li>
                        {/if}
                        {if !empty($tongyong_product)}
                        {loop $tongyong_list $t}
                        <?php if(!$default_url) $default_url = '/plugins/supplier_tongyong/index/index/typeid/'.$t['id'];?>
                        <li><a href="/plugins/supplier_tongyong/index/index/typeid/{$t['id']}" class="sub-item">{$t['modulename']}</a></li>
                        {/loop}
                        {/if}

                    </ul>
                </div>
            </li>

            <li class="menu_list_v menu_data" onclick="setTopMenuStyle('data')"><a href="/plugins/supplier/index/data" class="nav-item">数据</a></li>
            <?php } ?>
            <?php if($check_product){?>
                <li class="menu_list_v menu_check" onclick="setTopMenuStyle('check')"><a href="/plugins/supplier/index/menu_check" class="nav-item">验单</a></li>
            <?php }?>
            <li class="menu_list_v menu_set" onclick="setTopMenuStyle('set')"><a href="/plugins/supplier/pc/index/enterpriseinfo" class="nav-item">设置</a></li>
            {if $provider_status}
            <li class="menu_list_v menu_middle" onclick="setTopMenuStyle('middle')"><a href="/plugins/supplier/pc/provider/config" class="nav-item">供应配置</a></li>
            {/if}
        </ul>
    </div>
    <!-- nav -->
    <div class="header-admin">

        {if St_Functions::is_normal_app_install('zlhlorder') || St_Functions::is_normal_app_install('zlhlhotel')}
        <div class="header-admin-app">
            <span class="app-icon"></span>
            <div class="con-box hide">
                <div class="hd"><img src="{$GLOBALS['cfg_res_url']}/images/pic/qr_code.png" alt=""></div>
                <div class="bd">
                    <h4 class="tit">下载梦旅程APP，及时处理订单消息</h4>
                    <div class="txt">
                        步骤：<br />
                        1. 扫描左侧二维码下载梦旅程APP，并注册账号<br />
                        2. 绑定梦旅程账号，<a href="/plugins/supplier/pc/index/userinfo" class="t-lk">前往绑定</a>
                    </div>
                </div>
            </div>
        </div>
        {/if}
        <div class="header-admin-info">
            <a href="/plugins/supplier/pc/index/userinfo">
                <img class="img" src=" <?php if($litpic){echo $litpic;}else{ ?>{$GLOBALS['cfg_res_url']}/images/pic/hd-img.png<?php }?> " alt="">
                <span class="name"><?php echo ($userinfo['linkman'])?></span>
            </a>
        </div>
        <div class="header-admin-off"><a href="javascript:;" class="label-off admin_off" title="退出"></a></div>
    </div>
    <!-- admin -->
</div>

<?php echo Common::js("v1/jquery.min.js,v1/admin.js");?>
<script src="{$GLOBALS['cfg_res_url']}/js/v1/layer/layer.js"></script>
<script>
    //特殊处理逻辑
    if(!window.name){
        localStorage.setItem('menu_me','index');
        //alert("第一次开这个窗口！name值"+ window.name);
        window.name = 'test';
    }else {
        //alert('刷新操作 name值：' + window.name);
    }

    $(function(){

        //下载智旅互联APP
        $('.header-admin-app').hover(function(){
            $(this).children('.con-box').removeClass('hide')
        },function(){
            $(this).children('.con-box').addClass('hide')
        });

        //退出登录确认
        $('.admin_off').on('click', function(){
            layer.confirm('确认退出当前登录？',{
                title: '确认信息',
                area: ['300px'],
                btn: ['确认','取消']
            }, function(){
                layer.msg('退出成功!',{time: 800});
                window.name = '';
                setTimeout(function () {
                    window.location.href = "{$cmsurl}pc/login/login_out";
                },100);
            });
        });
        getTopMenuStyle('true');
    });

    //+--------------------------
    //顶部菜单样式控制
    function setTopMenuStyle(menu) {
        localStorage.setItem('menu_me',menu);
        getTopMenuStyle();
    }
    //顶部菜单样式控制子方法
    function getTopMenuStyle(isClick) {
        var menuMe = localStorage.getItem('menu_me');
        menuMe = menuMe ? menuMe : 'index';
        $('.menu_list_v').removeClass('cur_hover');
        $('.menu_'+menuMe).addClass('cur_hover');
        //console.log(menuMe);
    }


    //+顶部样式控制方法定义结束
    //+------------------------------------
</script>